$(document).ready(function() {


    var ue = UE.getEditor('editor',{
        initialFrameHeight:500,
        toolbars: [
            ['fullscreen', 'undo', 'redo'],
            ['bold', 'emotion',  'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc','simpleupload']
        ],
        autoHeightEnabled: false,
        autoFloatEnabled: false,
        elementPathEnabled:false,
        imagePathFormat: "/resources/js/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}"

    });




    $("#fabiaoBtn").click(function () {




        $.ajax({
            url:ip_port + "bbs/writereplysecond",
            type:"post",
            async: false,
            contentType: "application/json",
            dataType:"json",
            data:JSON.stringify({
                content:ue.getPlainTxt(),
                uid:$("#uid").val(),
                sid:$("#sid").val(),
                tid:$("#tid").val(),
                pid:$("#pid").val(),
                reply_uid:$("#replyUid").val()
            }),
            success:function (msg) {
                if(msg.status=="success"){


                    window.location.href=ip_port +　"bbs/opentopic?id=" + msg.data.tid;
                }else{

                    alert("error");
                }


            },error:function () {
                alert("error");
            }
        });
        return false;
    });






});